package com.guigu.service.impl.design;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.mapper.design.DModuleDetailsMapper;
import com.guigu.pojo.design.DModuleDetails;
import com.guigu.service.design.DModuleDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr.Zhang
 * @since 2024-12-06
 */
@Service
public class DModuleDetailsServiceImpl extends ServiceImpl<DModuleDetailsMapper, DModuleDetails> implements DModuleDetailsService {

    @Autowired
    private DModuleDetailsMapper dModuleDetailsMapper;

    @Override
    public ArrayList<DModuleDetails> selectArrByParentId(Integer parentId) {
//        QueryWrapper<DModuleDetails> queryWrapper = new QueryWrapper<>();
//        queryWrapper.eq("PARENT_ID", parentId);
//        ArrayList<DModuleDetails> dModuleDetails = (ArrayList<DModuleDetails>) dModuleDetailsMapper.selectList(queryWrapper);
        HashMap<String, Object> map = new HashMap<>();
        map.put("parentId", parentId);
        ArrayList<DModuleDetails> dModuleDetails = (ArrayList<DModuleDetails>) dModuleDetailsMapper.selectDModuleDetailsAndDProductUseByMap(map);
        return dModuleDetails;
    }
}
